using System;
using System.Collections.Generic;
using System.Text;
using RideMe.Core;
using RideMe.AddIns.Console.Properties;

namespace RideMe.AddIns.Console
{
    /// <summary>
    /// This fires up the script/console Ruby console and provides access to it
    /// </summary>
    internal class ConsoleProcess : ProcessBase
    {
        #region Methods

        /// <summary>
        /// This starts the console
        /// </summary>
        public void StartConsole()
        {
            RunCommand(Resources.ConsolePath, true);
        }

        /// <summary>
        /// This creates the custom process executor needed to launch the console
        /// </summary>
        /// <param name="arguments"></param>
        /// <param name="redirectStandardError"></param>
        public override void RunCommand(string arguments, bool redirectStandardError)
        {
            ProcessExecutor processExecutor = this.CreateCommand();

            processExecutor.ExecuteCommand(Options.Instance.RubyPath + Resources.RubyExePath, arguments, redirectStandardError);
        }

        #endregion
    }
}
